﻿//-----------------------------------------------------------------------------------------
// <copyright file="Entry.cs" company="Jakub Florczyk (www.jakubflorczyk.pl)">
//      Copyright © 2009 Jakub Florczyk (www.jakubflorczyk.pl)
//      http://flakernet.codeplex.com
// </copyright>
//-----------------------------------------------------------------------------------------

namespace FlakerNET
{
    using System;
    using FlakerNET.Converters;
    using Newtonsoft.Json;

    /// <summary>
    /// Definicja wpisu.
    /// </summary>
    public class Entry
    {
        /// <summary>
        /// Identyfikator wpisu.
        /// </summary>
        [JsonProperty("id")]
        [JsonConverter(typeof(Int32Converter))]
        public int Id { get; set; }

        /// <summary>
        /// Treść wpisu.
        /// </summary>
        [JsonProperty("text")]
        public string Text { get; set; }
                  
        /// <summary>
        /// Źródło wpisu.
        /// </summary>
        [JsonProperty("source")]
        public string Source { get; set; }

        ///// <summary>
        ///// Dane wpisu.
        ///// </summary>
        // [JsonProperty("data")]
        // public Data[] Data { get; set; }

        /// <summary>
        /// Data utworzenia.
        /// </summary>
        [JsonProperty("datetime")]
        public DateTime DateTime { get; set; }

        /// <summary>
        /// Timestamp.
        /// </summary>
        [JsonProperty("timestamp")]
        [JsonConverter(typeof(Int32Converter))]
        public int Timestamp { get; set; }

        /// <summary>
        /// Adres wpisu.
        /// </summary>
        [JsonProperty("permalink")]
        [JsonConverter(typeof(UriConverter))]
        public Uri Permalink { get; set; }

        /// <summary>
        /// Link wpisu.
        /// </summary>
        [JsonProperty("link")]
        public string Link { get; set; }
             
        /// <summary>
        /// Czy wpis zawiera zdjęcie.
        /// </summary>
        [JsonProperty("has_photo")]
        [JsonConverter(typeof(BooleanConverter))]
        public bool HasPhoto { get; set; }

        /// <summary>
        /// Czy wpis zawiera link.
        /// </summary>
        [JsonProperty("has_link")]
        [JsonConverter(typeof(BooleanConverter))]
        public bool HasLink { get; set; }

        /// <summary>
        /// Czy wpis zawiera film.
        /// </summary>
        [JsonProperty("has_video")]
        [JsonConverter(typeof(BooleanConverter))]
        public bool HasVideo { get; set; }

        /// <summary>
        /// Autor wpisu.
        /// </summary>
        [JsonProperty("user")]
        public User User { get; set; }

        /// <summary>
        /// Komentarze wpisu.
        /// </summary>
        [JsonProperty("comments")]
        public Comment[] Comments { get; set; }
    }
}
